﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MESMian.Migrations
{
    /// <inheritdoc />
    public partial class updatealittel : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "CreateUserName",
                table: "ProductCategories");

            migrationBuilder.DropColumn(
                name: "UpdateUserName",
                table: "ProductCategories");

            migrationBuilder.RenameColumn(
                name: "UpdateUserId",
                table: "ProductCategories",
                newName: "LastUpdateUserId");

            migrationBuilder.AlterColumn<int>(
                name: "Status",
                table: "ProductCategories",
                type: "int",
                nullable: false,
                defaultValue: 0,
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AddColumn<DateTime>(
                name: "CreatTime",
                table: "ProductCategories",
                type: "datetime",
                nullable: false,
                defaultValueSql: "GETDATE()");

            migrationBuilder.AddColumn<DateTime>(
                name: "LastUpdateTime",
                table: "ProductCategories",
                type: "datetime",
                nullable: true);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "CreatTime",
                table: "ProductCategories");

            migrationBuilder.DropColumn(
                name: "LastUpdateTime",
                table: "ProductCategories");

            migrationBuilder.RenameColumn(
                name: "LastUpdateUserId",
                table: "ProductCategories",
                newName: "UpdateUserId");

            migrationBuilder.AlterColumn<int>(
                name: "Status",
                table: "ProductCategories",
                type: "int",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int",
                oldDefaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "CreateUserName",
                table: "ProductCategories",
                type: "dateTime",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<DateTime>(
                name: "UpdateUserName",
                table: "ProductCategories",
                type: "dateTime",
                nullable: true);
        }
    }
}
